/**
 *                            License
 * THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS  
 * CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). 
 * THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW.  
 * ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR  
 * COPYRIGHT LAW IS PROHIBITED.
 * 
 * BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND  
 * AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE  
 * MAY BE CONSIDERED TO BE A CONTRACT,
 * THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED 
 * HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
 * 
 */
package com.lineage.server.model.item.etcitem.action;

import com.lineage.server.model.Instance.L1ItemInstance;
import com.lineage.server.model.Instance.L1PcInstance;
import com.lineage.server.model.item.ItemExecutor;
import com.lineage.server.model.item.etcitem.CiteScrollEnchant;

/**
 * Class <code>ScrollWeapon</code> 对武器施法的卷轴.<br>
 * 40077 - 古代人的练金术卷轴 <br>
 * 40087 - 对武器施法的卷轴 <br>
 * 40128 - 对武器施法的幻象卷轴 <br>
 * 40130 - 金侃的卷轴 <br>
 * 40660 - 试炼卷轴 <br>
 * 41429 - 风之武器强化卷轴 <br>
 * 41430 - 地之武器强化卷轴 <br>
 * 41431 - 水之武器强化卷轴 <br>
 * 41432 - 火之武器强化卷轴 <br>
 * 49312 - 象牙塔对武器施法的卷轴 <br>
 * 140087 - 受祝福的 对武器施法的卷轴 <br>
 * 140130 - 受祝福的 金侃的卷轴 <br>
 * 240087 - 受祝福的 对武器施法的卷轴 <br>
 * 
 * @author jrwz
 * @version 2012-6-19下午03:47:21
 * @see com.lineage.server.model.item.etcitem.action
 * @since JDK1.7
 */
public final class ScrollWeapon extends ItemExecutor {

    /**
     * 取得实例.
     * 
     * @return 实例
     */
    public static ItemExecutor get() {
        return new ScrollWeapon();
    }

    /** 对武器施法的卷轴. */
    private ScrollWeapon() {
    }

    @Override
    public void execute(final L1PcInstance pc, final L1ItemInstance useItem,
            final int readC1, final int readC2, final int targetId,
            final int targetX, final int targetY) {
        final int targetID = targetId;
        final L1ItemInstance l1iteminstance1 = pc.getInventory().getItem(
                targetID);
        final int itemId = useItem.getItemId();

        switch (itemId) {
            case 49312: // 象牙塔对武器施法的卷轴
                CiteScrollEnchant.get().scrollOfEnchantWeaponIvoryTower(pc,
                        useItem, l1iteminstance1);
                break;

            case 41429: // 风之武器强化卷轴
            case 41430: // 地之武器强化卷轴
            case 41431: // 水之武器强化卷轴
            case 41432: // 火之武器强化卷轴
                CiteScrollEnchant.get().scrollOfEnchantWeaponAttr(pc, useItem,
                        l1iteminstance1);
                break;

            default: // 其他
                CiteScrollEnchant.get().scrollOfEnchantWeapon(pc, useItem,
                        l1iteminstance1);
                break;
        }
    }
}
